package cn.tarena.ht.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import cn.tarena.ht.pojo.User;

public interface UserMapper {
	public List<User> findUserList();

	public void deletUser(String[] userIds);

	public void addUser(User user);

	public User finUserById(String uid);

	public void updateUser(@Param("user") User user, @Param("olduId") String olduId);

	public void addUser_Role(@Param("userId")String userId,@Param("roleId") String roleId);
	
	@Select(value="select role_id from role_user_p where user_id= #{userId}")
	public List<String> findRoleById(String userId);

	@Delete(value="delete  from role_user_p where user_id= #{userId}")
	public void deleUser_role(String userId);

	@Select(value="select * from user_p where userName=#{userName} and password=#{password} ")
	public User findUserByNaAndPa(@Param("userName" )String userName,@Param("password") String password);

	public User findUserByuserName(String userName);

	public List<String> findModuleNameByUserId(String userId);

}
